package com.twu.biblioteca;

public class User {
    static Integer userNumber = 1111111;
    private String userName;
    private String password;
    private String emailAddress;
    private String phoneNumber;

    public User(String password, String emailAddress, String phoneNumber) {
        userNameGenerator();
        this.password = password;
        this.emailAddress = emailAddress;
        this.phoneNumber = phoneNumber;
    }

    public static void Reset() {
        userNumber = 1111111;
    }

    public String userNameGenerator() {
        userName = new StringBuffer(userNumber + "").insert(3, '-').toString();
        userNumber = userNumber + 1;
        return userName;
    }

    public String getUserName() {
        return userName;
    }

    public String getPassword() {
        return password;
    }

    public String getUserInfo() {
        return userName + " " + emailAddress + " " + phoneNumber;
    }

}
